package com.ruoyi.system.service;

import com.ruoyi.system.api.domain.File;
import com.ruoyi.system.api.domain.FileData;
import com.ruoyi.system.api.domain.FileObject;
import com.ruoyi.system.domain.FileAuth;
import com.ruoyi.system.domain.FileRecord;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 附件Service接口
 * 
 * @author ruoyi
 * @date 2023-02-22
 */
public interface IFileService 
{
    /**
     * 查询附件
     * 
     * @param fileId 附件主键
     * @return 附件
     */
    public File selectFileByFileId(Long fileId);

    /**
     * 查询附件列表
     * 
     * @param file 附件
     * @return 附件集合
     */
    public List<File> selectFileList(File file);

    public List<FileData> selectFileDataList(FileData fileDate);


    public List<File> selectFileListByGroupId(Long groupId,String typeIds );

    public FileData selectFileDataBYDataId(Long dataId);

    public List<FileData> selectFileDataListByGroupId(Long groupId,String fileTypes);

    /**
     * 新增附件
     * 
     * @param file 附件
     * @return 结果
     */
    public int insertFile(File file);


    public boolean saveFileDataList(FileObject fileObject);

    public boolean saveFile(Long groupId,Integer typeId, List<Long> fileIds);

    public boolean saveFileData(FileData fileData);

    /**
     * 批量删除附件
     * 
     * @param fileIds 需要删除的附件主键集合
     * @return 结果
     */
    public int deleteFileByFileIds(Long[] fileIds);

    /**
     * 删除附件信息
     * 
     * @param fileId 附件主键
     * @return 结果
     */
    public int deleteFileByFileId(Long fileId);

    public int deleteFileDataByDataId(String[] dataIds);

    int saveFile(File file);

    int addFileAuth(FileAuth fileAuth);

    List<FileRecord> selectFileRecordList(FileRecord fileRecord);

    public int splitFileList(File file);

    String download(File file, HttpServletResponse response) throws IOException;

    int removeFile(Long fileId);

    int deleteFileByProcInsId(File file);
}
